var db = require("./database.js");

/*
  everyone: the object now.js generates -- used to bind methods
  user: the current(ly) logged in user
*/

exports = function(everyone, user) {
  everyone.now.hello = function(who,callback) {callback("Hello "+who)};
  everyone.now.spam = function(t) {everyone.now.alert(t)};
  everyone.now.broadcastNotification = function(opts) {everyone.now.notify(opts);};

  everyone.now.createIdea = function(opts) {
    eyes.inspect(opts, "Creating idea. Opts are");
    
    db.projects.insert({
      title: opts.title,
      body: opts.body,
      owner: theUser._id["$oid"],
      phase: 'idea'
    }, function(err) {eyes.inspect(err, "The Err")});
  };


  everyone.now.authenticate = function(username, password) {

  }
  everyone.now.login = everyone.now.authenticate; // alias
}